/*
 * @Author: ischen.x ischen.x@foxmail.com
 * @Date: 2024-08-22 13:13:18
 * @LastEditors: ischen.x ischen.x@foxmail.com
 * @LastEditTime: 2024-08-23 16:32:15
 * 
 * Copyright (c) 2024 by fhchengz, All Rights Reserved. 
 */
#ifndef __MCP3021_H
#define __MCP3021_H

#include <stdint.h>

typedef int(*mcp3021_i2c_read_fun)(uint8_t dev_addr, uint8_t *data, uint8_t len);
typedef int(*mcp3021_i2c_write_fun)(uint8_t dev_addr, uint8_t *data, uint8_t len);

int mcp3021_set_i2c_read_write_intf(mcp3021_i2c_read_fun, mcp3021_i2c_write_fun);
int mcp3021_get_voltage(double *voltage);

#endif /* __MCP3021_H */